package servlet;

import redis.MessageConsumerImage;
import redis.MessageConsumerText;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class MessageConsumerThread implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
            MessageConsumerImage mc = new MessageConsumerImage();
            Thread t1 = new Thread(mc, "Listen_task_que");
            t1.start();
            MessageConsumerText mc2 = new MessageConsumerText();
            Thread t2 = new Thread(mc2, "Listen_task_que2");
            t2.start();
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        ServletContextListener.super.contextDestroyed(sce);
    }
}
